//
//  GotoSetting.swift
//  BasicTools
//
//  Created by ikang on 2025/8/28.
//


#if os(iOS)
import Foundation
import UIKit

// iOS 10
//定位到特定应用程序或功能的页面：
//App Store: itms-apps://
//联系人: contacts://
//FaceTime: facetime://
//邮件: mailto://
//Google 地图: comgooglemaps://
//Apple 地图: http://maps.apple.com/
//照片: photos-redirect://
//电话拨号: tel://
//短信: sms://
//日历：calshow://
//音乐：music://
//Apple 音乐：music://
//视频：videos://或video://
//钱包：shoebox://
//设置：App-Prefs://或App-Settings://
//FaceTime： facetime://或facetime-audio://
//商店itms-apps://itunes.apple.com/app/App_id


public struct GotoSetting {
    
    // 跳转设置
    static public func openSetting() {
        openUrl(urlStr: UIApplication.openSettingsURLString)
    }
    
    // 打开其他应用
    static public func openUrl(urlStr: String) {
        guard let stringURL = URL(string: urlStr) else { return }
        
        if UIApplication.shared.canOpenURL(stringURL) {
            UIApplication.shared.open(stringURL)
        }
    }
}

#endif
